import { createRouter, createWebHashHistory } from "vue-router"

const routes = [
  {
    path: "/",
    name: "Index",
    component: () => import("../views/Index.vue"),
    meta: {
      keepAlive: true,
    },
    children: [
      {
        path: "/",
        name: "IndexContent",
        component: () => import("../views/IndexContent.vue"),
        meta: {
          keepAlive: true,
        },
      },
      {
        path: "/detail",
        name: "IndexContentDetail",
        component: () => import("../views/IndexContentDetail.vue"),
        meta: {
          keepAlive: true,
        },
      },
    ],
  },
  {
    path: "/mindex",
    name: "mIndex",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/Indexm.vue"),
    children: [
      {
        path: "/mindex",
        name: "MIndexContent",
        component: () => import("../views/mindexContent.vue"),
        meta: {
          keepAlive: true,
        },
      },
      {
        path: "/mindexdetail",
        name: "mIndexContentDetail",
        component: () => import("../views/mindexContentDetail.vue"),
        meta: {
          keepAlive: true,
        },
      },
    ],
  },
]

const router = createRouter({
  history: createWebHashHistory(),
  routes,
})

export default router
